package visual;

import java.awt.Dimension;
import javax.swing.JPanel;
import java.awt.GridBagLayout;
import javax.swing.JLabel;

import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.BorderLayout;
import java.awt.Font;
import javax.swing.JTabbedPane;
import java.awt.Rectangle;

import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.JComboBox;
import javax.swing.JTextArea;
import javax.swing.BorderFactory;
import javax.swing.border.BevelBorder;
import javax.swing.JCheckBox;

import modelo.Empresa;
import negocio.GerenciadorEmpresa;

public class FrmCadastroEmpresa extends FormularioBase {

	private JPanel jPanel = null;
	private JLabel jLabel = null;
	private BarraDeControle barraDeControle = null;
	private JTabbedPane jTabbedPane = null;
	private JPanel empresaPanel = null;
	private JPanel calculoPanel = null;
	private JLabel codEmpresaLabel = null;
	private JLabel razaoSocialLabel = null;
	private JTextField codEmpresaTextField = null;
	private JTextField razaoSocialTextField = null;
	private JLabel cnpjLabel = null;
	private JTextField cnpjTextField = null;
	private JLabel emailLabel = null;
	private JTextField emailTextField = null;
	private JLabel siteLabel = null;
	private JTextField siteTextField = null;
	private JLabel dadosEmpresaLabel = null;
	private JLabel InformacoesComplementaresLabel = null;
	private JLabel codAtividadeLabel = null;
	private JLabel naturezaJuridicaLabel = null;
	private JComboBox codAtividadeComboBox = null;
	private JComboBox naturezaJuridicaComboBox = null;
	private JLabel enderecoLabel = null;
	private JTextField ruaTextField = null;
	private JLabel numeroLabel = null;
	private JTextField numeroTextField = null;
	private JLabel complementoLabel = null;
	private JTextField complementoTextField = null;
	private JLabel bairroLabel = null;
	private JTextField bairroTextField = null;
	private JLabel codMunicipioLabel = null;
	private JComboBox codMunicipioComboBox = null;
	private JLabel cidadeLabel = null;
	private JTextField cidadeTextField = null;
	private JLabel ufLabel = null;
	private JComboBox ufComboBox = null;
	private JLabel cepLabel = null;
	private JTextField cepTextField = null;
	private JLabel telefonesLabel = null;
	private JLabel faxLabel = null;
	private JTextField faxTextField = null;
	private JTextField telefoneTextField = null;
	private JPanel eventoPanel = null;
	private JPanel aliquotaGpsPanel = null;
	private JPanel mesesParaMediaPanel = null;
	private JLabel jLabel18 = null;
	private JComboBox jComboBox4 = null;
	private JPanel outrosPanel = null;
	private JLabel eventoLabel = null;
	private JTextField codQuinquenioTextField = null;
	private JTextField periodoAnoTextField = null;
	private JLabel jLabel20 = null;
	private JLabel jLabel21 = null;
	private JLabel mesesParaMediaLabel = null;
	private JTextField calcDeFeriasTextField = null;
	private JTextField calc13salarioTextField = null;
	private JLabel jLabel19 = null;
	private JLabel jLabel22 = null;
	private JLabel aliquotaGpsLabel = null;
	private JLabel jLabel23 = null;
	private JLabel jLabel24 = null;
	private JLabel jLabel25 = null;
	private JLabel jLabel26 = null;
	private JTextField empresaTextField = null;
	private JTextField segAcidenteTextField = null;
	private JTextField terceiroTextField = null;
	private JTextField codTerceiroTextField = null;
	private JLabel jLabel27 = null;
	private JLabel jLabel271 = null;
	private JLabel jLabel272 = null;
	private JLabel outrosLabel = null;
	private JLabel jLabel29 = null;
	private JCheckBox contribuicaoSindicalAutomaticaCheckBox = null;
	private JLabel jLabel30 = null;
	private JCheckBox mesComercial30diasCheckBox = null;
	/**
	 * This method initializes 
	 * 
	 */
	public FrmCadastroEmpresa() {
		super(null);
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 */
	private void initialize() {
        this.setSize(new Dimension(693, 496));
        this.setContentPane(getJPanel());
        this.setTitle(jLabel.getText());
        this.addWindowListener(new java.awt.event.WindowAdapter() {
        	public void windowOpened(java.awt.event.WindowEvent e) {
        		setId(1);
        		carregaFormulario();
        	}
        });
        getBarraDeControle().setFormulario(this);
        getBarraDeControle().ativaBotoes  (false, false,false, true,  true,  false);
        getBarraDeControle().removerBotoes(true,  true, false, false, false, false);
			
	}
	
	/**
	 * This method initializes jPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getJPanel() {
		if (jPanel == null) {
			jLabel = new JLabel();
			jLabel.setText("Cadastro Empresa");
			jLabel.setFont(new Font("Dialog", Font.BOLD, 24));
			jPanel = new JPanel();
			jPanel.setLayout(new BorderLayout());
			jPanel.add(jLabel, BorderLayout.NORTH);
			jPanel.add(getBarraDeControle(), BorderLayout.SOUTH);
			jPanel.add(getJTabbedPane(), BorderLayout.CENTER);
		}
		return jPanel;
	}

	/**
	 * This method initializes barraDeControle	
	 * 	
	 * @return visual.BarraDeControle	
	 */
	private BarraDeControle getBarraDeControle() {
		if (barraDeControle == null) {
			barraDeControle = new BarraDeControle();
		}
		return barraDeControle;
	}

	/**
	 * This method initializes jTabbedPane	
	 * 	
	 * @return javax.swing.JTabbedPane	
	 */
	private JTabbedPane getJTabbedPane() {
		if (jTabbedPane == null) {
			jTabbedPane = new JTabbedPane();
			jTabbedPane.addTab("Empresa", null, getEmpresaPanel(), null);
			jTabbedPane.addTab("Calculo", null, getCalculoPanel(), null);
		}
		return jTabbedPane;
	}

	/**
	 * This method initializes empresaPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getEmpresaPanel() {
		if (empresaPanel == null) {
			faxLabel = new JLabel();
			faxLabel.setBounds(new Rectangle(406, 194, 29, 14));
			faxLabel.setText("Fax:");
			telefonesLabel = new JLabel();
			telefonesLabel.setBounds(new Rectangle(62, 194, 75, 14));
			telefonesLabel.setText("Telefones:");
			cepLabel = new JLabel();
			cepLabel.setBounds(new Rectangle(482, 166, 31, 14));
			cepLabel.setText("CEP:");
			ufLabel = new JLabel();
			ufLabel.setBounds(new Rectangle(381, 166, 23, 14));
			ufLabel.setText("UF:");
			cidadeLabel = new JLabel();
			cidadeLabel.setBounds(new Rectangle(83, 166, 54, 14));
			cidadeLabel.setText("Cidade:");
			codMunicipioLabel = new JLabel();
			codMunicipioLabel.setBounds(new Rectangle(476, 138, 108, 14));
			codMunicipioLabel.setText("Cod. Município:");
			bairroLabel = new JLabel();
			bairroLabel.setBounds(new Rectangle(302, 138, 48, 14));
			bairroLabel.setText("Bairro:");
			complementoLabel = new JLabel();
			complementoLabel.setBounds(new Rectangle(35, 138, 102, 14));
			complementoLabel.setText("Complemento:");
			numeroLabel = new JLabel();
			numeroLabel.setBounds(new Rectangle(510, 110, 60, 14));
			numeroLabel.setText("Número:");
			enderecoLabel = new JLabel();
			enderecoLabel.setBounds(new Rectangle(66, 110, 71, 14));
			enderecoLabel.setText("Endereço:");
			naturezaJuridicaLabel = new JLabel();
			naturezaJuridicaLabel.setBounds(new Rectangle(48, 307, 127, 14));
			naturezaJuridicaLabel.setText("Natureza jurídica:");
			codAtividadeLabel = new JLabel();
			codAtividadeLabel.setBounds(new Rectangle(65, 276, 107, 14));
			codAtividadeLabel.setText("Cod. Atividade:");
			InformacoesComplementaresLabel = new JLabel();
			InformacoesComplementaresLabel.setBounds(new Rectangle(15, 248, 209, 14));
			InformacoesComplementaresLabel.setText("Informações complementares");
			InformacoesComplementaresLabel.setForeground(Color.red);
			dadosEmpresaLabel = new JLabel();
			dadosEmpresaLabel.setBounds(new Rectangle(14, 3, 138, 14));
			dadosEmpresaLabel.setText("Dados da empresa");
			dadosEmpresaLabel.setForeground(Color.red);
			siteLabel = new JLabel();
			siteLabel.setBounds(new Rectangle(387, 82, 43, 14));
			siteLabel.setText("Site:");
			emailLabel = new JLabel();
			emailLabel.setBounds(new Rectangle(95, 82, 42, 14));
			emailLabel.setText("EMail:");
			cnpjLabel = new JLabel();
			cnpjLabel.setBounds(new Rectangle(476, 54, 43, 14));
			cnpjLabel.setText("CNPJ:");
			razaoSocialLabel = new JLabel();
			razaoSocialLabel.setBounds(new Rectangle(43, 54, 94, 14));
			razaoSocialLabel.setText("Razão social:");
			codEmpresaLabel = new JLabel();
			codEmpresaLabel.setBounds(new Rectangle(35, 26, 102, 14));
			codEmpresaLabel.setText("Cod. Empresa:");
			empresaPanel = new JPanel();
			empresaPanel.setLayout(null);
			empresaPanel.add(codEmpresaLabel, null);
			empresaPanel.add(razaoSocialLabel, null);
			empresaPanel.add(getCodEmpresaTextField(), null);
			empresaPanel.add(getRazaoSocialTextField(), null);
			empresaPanel.add(cnpjLabel, null);
			empresaPanel.add(getCnpjTextField(), null);
			empresaPanel.add(emailLabel, null);
			empresaPanel.add(getEmailTextField(), null);
			empresaPanel.add(siteLabel, null);
			empresaPanel.add(getSiteTextField(), null);
			empresaPanel.add(dadosEmpresaLabel, null);
			empresaPanel.add(InformacoesComplementaresLabel, null);
			empresaPanel.add(codAtividadeLabel, null);
			empresaPanel.add(naturezaJuridicaLabel, null);
			empresaPanel.add(getCodAtividadeComboBox(), null);
			empresaPanel.add(getNaturezaJuridicaComboBox(), null);
			empresaPanel.add(enderecoLabel, null);
			empresaPanel.add(getRuaTextField(), null);
			empresaPanel.add(numeroLabel, null);
			empresaPanel.add(getNumeroTextField(), null);
			empresaPanel.add(complementoLabel, null);
			empresaPanel.add(getComplementoTextField(), null);
			empresaPanel.add(bairroLabel, null);
			empresaPanel.add(getBairroTextField(), null);
			empresaPanel.add(codMunicipioLabel, null);
			empresaPanel.add(getCodMunicipioComboBox(), null);
			empresaPanel.add(cidadeLabel, null);
			empresaPanel.add(getCidadeTextField(), null);
			empresaPanel.add(ufLabel, null);
			empresaPanel.add(getUfComboBox(), null);
			empresaPanel.add(cepLabel, null);
			empresaPanel.add(getCepTextField(), null);
			empresaPanel.add(telefonesLabel, null);
			empresaPanel.add(faxLabel, null);
			empresaPanel.add(getFaxTextField(), null);
			empresaPanel.add(getTelefoneTextField(), null);
		}
		return empresaPanel;
	}

	/**
	 * This method initializes calculoPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getCalculoPanel() {
		if (calculoPanel == null) {
			jLabel18 = new JLabel();
			jLabel18.setBounds(new Rectangle(29, 19, 120, 14));
			jLabel18.setText("Tipo pagamento:");
			calculoPanel = new JPanel();
			calculoPanel.setLayout(null);
			calculoPanel.add(getEventoPanel(), null);
			calculoPanel.add(getAliquotaGpsPanel(), null);
			calculoPanel.add(getMesesParaMediaPanel(), null);
			calculoPanel.add(jLabel18, null);
			calculoPanel.add(getJComboBox4(), null);
			calculoPanel.add(getOutrosPanel(), null);
		}
		return calculoPanel;
	}

	/**
	 * This method initializes codEmpresaTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getCodEmpresaTextField() {
		if (codEmpresaTextField == null) {
			codEmpresaTextField = new JTextField();
			codEmpresaTextField.setBounds(new Rectangle(146, 25, 78, 18));
		}
		return codEmpresaTextField;
	}

	/**
	 * This method initializes razaoSocialTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getRazaoSocialTextField() {
		if (razaoSocialTextField == null) {
			razaoSocialTextField = new JTextField();
			razaoSocialTextField.setBounds(new Rectangle(146, 53, 315, 18));
		}
		return razaoSocialTextField;
	}

	/**
	 * This method initializes cnpjTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getCnpjTextField() {
		if (cnpjTextField == null) {
			cnpjTextField = new JTextField();
			cnpjTextField.setBounds(new Rectangle(523, 53, 142, 18));
		}
		return cnpjTextField;
	}

	/**
	 * This method initializes emailTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getEmailTextField() {
		if (emailTextField == null) {
			emailTextField = new JTextField();
			emailTextField.setBounds(new Rectangle(146, 81, 220, 18));
		}
		return emailTextField;
	}

	/**
	 * This method initializes siteTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getSiteTextField() {
		if (siteTextField == null) {
			siteTextField = new JTextField();
			siteTextField.setBounds(new Rectangle(440, 81, 220, 18));
		}
		return siteTextField;
	}

	/**
	 * This method initializes codAtividadeComboBox	
	 * 	
	 * @return javax.swing.JComboBox	
	 */
	private JComboBox getCodAtividadeComboBox() {
		if (codAtividadeComboBox == null) {
			codAtividadeComboBox = new JComboBox();
			codAtividadeComboBox.setBounds(new Rectangle(177, 272, 478, 23));
		}
		return codAtividadeComboBox;
	}

	/**
	 * This method initializes naturezaJuridicaComboBox	
	 * 	
	 * @return javax.swing.JComboBox	
	 */
	private JComboBox getNaturezaJuridicaComboBox() {
		if (naturezaJuridicaComboBox == null) {
			naturezaJuridicaComboBox = new JComboBox();
			naturezaJuridicaComboBox.setBounds(new Rectangle(177, 303, 478, 23));
		}
		return naturezaJuridicaComboBox;
	}

	/**
	 * This method initializes ruaTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getRuaTextField() {
		if (ruaTextField == null) {
			ruaTextField = new JTextField();
			ruaTextField.setBounds(new Rectangle(146, 109, 352, 18));
		}
		return ruaTextField;
	}

	/**
	 * This method initializes numeroTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getNumeroTextField() {
		if (numeroTextField == null) {
			numeroTextField = new JTextField();
			numeroTextField.setBounds(new Rectangle(582, 107, 80, 18));
		}
		return numeroTextField;
	}

	/**
	 * This method initializes complementoTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getComplementoTextField() {
		if (complementoTextField == null) {
			complementoTextField = new JTextField();
			complementoTextField.setBounds(new Rectangle(146, 137, 147, 18));
		}
		return complementoTextField;
	}

	/**
	 * This method initializes bairroTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getBairroTextField() {
		if (bairroTextField == null) {
			bairroTextField = new JTextField();
			bairroTextField.setBounds(new Rectangle(361, 137, 108, 18));
		}
		return bairroTextField;
	}

	/**
	 * This method initializes codMunicipioComboBox	
	 * 	
	 * @return javax.swing.JComboBox	
	 */
	private JComboBox getCodMunicipioComboBox() {
		if (codMunicipioComboBox == null) {
			codMunicipioComboBox = new JComboBox();
			codMunicipioComboBox.setBounds(new Rectangle(585, 133, 77, 23));
		}
		return codMunicipioComboBox;
	}

	/**
	 * This method initializes cidadeTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getCidadeTextField() {
		if (cidadeTextField == null) {
			cidadeTextField = new JTextField();
			cidadeTextField.setBounds(new Rectangle(146, 165, 221, 18));
		}
		return cidadeTextField;
	}

	/**
	 * This method initializes ufComboBox	
	 * 	
	 * @return javax.swing.JComboBox	
	 */
	private JComboBox getUfComboBox() {
		if (ufComboBox == null) {
			ufComboBox = new JComboBox();
			ufComboBox.setBounds(new Rectangle(412, 165, 60, 23));
		}
		return ufComboBox;
	}

	/**
	 * This method initializes cepTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getCepTextField() {
		if (cepTextField == null) {
			cepTextField = new JTextField();
			cepTextField.setBounds(new Rectangle(522, 165, 137, 18));
		}
		return cepTextField;
	}

	/**
	 * This method initializes faxTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getFaxTextField() {
		if (faxTextField == null) {
			faxTextField = new JTextField();
			faxTextField.setBounds(new Rectangle(445, 194, 211, 18));
		}
		return faxTextField;
	}

	/**
	 * This method initializes telefoneTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getTelefoneTextField() {
		if (telefoneTextField == null) {
			telefoneTextField = new JTextField();
			telefoneTextField.setBounds(new Rectangle(146, 193, 240, 18));
		}
		return telefoneTextField;
	}

	/**
	 * This method initializes eventoPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getEventoPanel() {
		if (eventoPanel == null) {
			jLabel21 = new JLabel();
			jLabel21.setBounds(new Rectangle(36, 67, 99, 14));
			jLabel21.setText("Período anos:");
			jLabel20 = new JLabel();
			jLabel20.setBounds(new Rectangle(13, 38, 122, 14));
			jLabel20.setText("Cod. Quinquênio:");
			eventoLabel = new JLabel();
			eventoLabel.setBounds(new Rectangle(138, 13, 61, 14));
			eventoLabel.setText("Eventos:");
			eventoLabel.setForeground(Color.red);
			eventoPanel = new JPanel();
			eventoPanel.setLayout(null);
			eventoPanel.setBounds(new Rectangle(15, 45, 290, 112));
			eventoPanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
			eventoPanel.add(eventoLabel, null);
			eventoPanel.add(getCodQuinquenioTextField(), null);
			eventoPanel.add(getPeriodoAnoTextField(), null);
			eventoPanel.add(jLabel20, null);
			eventoPanel.add(jLabel21, null);
		}
		return eventoPanel;
	}

	/**
	 * This method initializes aliquotaGpsPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getAliquotaGpsPanel() {
		if (aliquotaGpsPanel == null) {
			jLabel272 = new JLabel();
			jLabel272.setBounds(new Rectangle(234, 106, 12, 14));
			jLabel272.setText("%");
			jLabel271 = new JLabel();
			jLabel271.setBounds(new Rectangle(234, 76, 12, 14));
			jLabel271.setText("%");
			jLabel27 = new JLabel();
			jLabel27.setBounds(new Rectangle(234, 46, 12, 14));
			jLabel27.setText("%");
			jLabel26 = new JLabel();
			jLabel26.setBounds(new Rectangle(8, 139, 119, 14));
			jLabel26.setText("Cód. de terceiro:");
			jLabel25 = new JLabel();
			jLabel25.setBounds(new Rectangle(63, 109, 63, 14));
			jLabel25.setText("Terceiro:");
			jLabel24 = new JLabel();
			jLabel24.setBounds(new Rectangle(23, 79, 103, 14));
			jLabel24.setText("Seg. Acidente:");
			jLabel23 = new JLabel();
			jLabel23.setBounds(new Rectangle(60, 49, 66, 14));
			jLabel23.setText("Empresa:");
			aliquotaGpsLabel = new JLabel();
			aliquotaGpsLabel.setBounds(new Rectangle(125, 16, 96, 14));
			aliquotaGpsLabel.setText("Alíquota GPS:");
			aliquotaGpsLabel.setForeground(Color.red);
			aliquotaGpsPanel = new JPanel();
			aliquotaGpsPanel.setLayout(null);
			aliquotaGpsPanel.setBounds(new Rectangle(315, 45, 303, 226));
			aliquotaGpsPanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
			aliquotaGpsPanel.add(aliquotaGpsLabel, null);
			aliquotaGpsPanel.add(jLabel23, null);
			aliquotaGpsPanel.add(jLabel24, null);
			aliquotaGpsPanel.add(jLabel25, null);
			aliquotaGpsPanel.add(jLabel26, null);
			aliquotaGpsPanel.add(getEmpresaTextField(), null);
			aliquotaGpsPanel.add(getSegAcidenteTextField(), null);
			aliquotaGpsPanel.add(getTerceiroTextField(), null);
			aliquotaGpsPanel.add(getCodTerceiroTextField(), null);
			aliquotaGpsPanel.add(jLabel27, null);
			aliquotaGpsPanel.add(jLabel271, null);
			aliquotaGpsPanel.add(jLabel272, null);
		}
		return aliquotaGpsPanel;
	}

	/**
	 * This method initializes mesesParaMediaPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getMesesParaMediaPanel() {
		if (mesesParaMediaPanel == null) {
			jLabel22 = new JLabel();
			jLabel22.setBounds(new Rectangle(15, 60, 121, 14));
			jLabel22.setText("Cálc. 13o salário:");
			jLabel19 = new JLabel();
			jLabel19.setBounds(new Rectangle(30, 30, 106, 14));
			jLabel19.setText("Cálc. de férias:");
			mesesParaMediaLabel = new JLabel();
			mesesParaMediaLabel.setBounds(new Rectangle(86, 11, 135, 14));
			mesesParaMediaLabel.setText("Meses para média:");
			mesesParaMediaLabel.setForeground(Color.red);
			mesesParaMediaPanel = new JPanel();
			mesesParaMediaPanel.setLayout(null);
			mesesParaMediaPanel.setBounds(new Rectangle(15, 165, 290, 103));
			mesesParaMediaPanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
			mesesParaMediaPanel.add(mesesParaMediaLabel, null);
			mesesParaMediaPanel.add(getCalcDeFeriasTextField(), null);
			mesesParaMediaPanel.add(getCalc13salarioTextField(), null);
			mesesParaMediaPanel.add(jLabel19, null);
			mesesParaMediaPanel.add(jLabel22, null);
		}
		return mesesParaMediaPanel;
	}

	/**
	 * This method initializes jComboBox4	
	 * 	
	 * @return javax.swing.JComboBox	
	 */
	private JComboBox getJComboBox4() {
		if (jComboBox4 == null) {
			jComboBox4 = new JComboBox();
			jComboBox4.setBounds(new Rectangle(155, 13, 187, 23));
		}
		return jComboBox4;
	}

	/**
	 * This method initializes outrosPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getOutrosPanel() {
		if (outrosPanel == null) {
			jLabel30 = new JLabel();
			jLabel30.setBounds(new Rectangle(91, 53, 177, 14));
			jLabel30.setText("Mês comercial ( 30 dias ):");
			jLabel29 = new JLabel();
			jLabel29.setBounds(new Rectangle(30, 28, 237, 14));
			jLabel29.setText("Contribuição sindical automática:");
			outrosLabel = new JLabel();
			outrosLabel.setBounds(new Rectangle(194, 6, 54, 14));
			outrosLabel.setText("Outros:");
			outrosLabel.setForeground(Color.red);
			outrosPanel = new JPanel();
			outrosPanel.setLayout(null);
			outrosPanel.setBounds(new Rectangle(15, 285, 601, 82));
			outrosPanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
			outrosPanel.add(outrosLabel, null);
			outrosPanel.add(jLabel29, null);
			outrosPanel.add(getContribuicaoSindicalAutomaticaCheckBox(), null);
			outrosPanel.add(jLabel30, null);
			outrosPanel.add(getMesComercial30diasCheckBox(), null);
		}
		return outrosPanel;
	}

	/**
	 * This method initializes codQuinquenioTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getCodQuinquenioTextField() {
		if (codQuinquenioTextField == null) {
			codQuinquenioTextField = new JTextField();
			codQuinquenioTextField.setBounds(new Rectangle(137, 34, 105, 18));
		}
		return codQuinquenioTextField;
	}

	/**
	 * This method initializes periodoAnoTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getPeriodoAnoTextField() {
		if (periodoAnoTextField == null) {
			periodoAnoTextField = new JTextField();
			periodoAnoTextField.setBounds(new Rectangle(137, 63, 105, 18));
		}
		return periodoAnoTextField;
	}

	/**
	 * This method initializes calcDeFeriasTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getCalcDeFeriasTextField() {
		if (calcDeFeriasTextField == null) {
			calcDeFeriasTextField = new JTextField();
			calcDeFeriasTextField.setBounds(new Rectangle(135, 30, 112, 18));
		}
		return calcDeFeriasTextField;
	}

	/**
	 * This method initializes calc13salarioTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getCalc13salarioTextField() {
		if (calc13salarioTextField == null) {
			calc13salarioTextField = new JTextField();
			calc13salarioTextField.setBounds(new Rectangle(135, 60, 112, 18));
		}
		return calc13salarioTextField;
	}

	/**
	 * This method initializes empresaTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getEmpresaTextField() {
		if (empresaTextField == null) {
			empresaTextField = new JTextField();
			empresaTextField.setBounds(new Rectangle(135, 45, 91, 18));
		}
		return empresaTextField;
	}

	/**
	 * This method initializes segAcidenteTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getSegAcidenteTextField() {
		if (segAcidenteTextField == null) {
			segAcidenteTextField = new JTextField();
			segAcidenteTextField.setBounds(new Rectangle(135, 75, 91, 18));
		}
		return segAcidenteTextField;
	}

	/**
	 * This method initializes terceiroTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getTerceiroTextField() {
		if (terceiroTextField == null) {
			terceiroTextField = new JTextField();
			terceiroTextField.setBounds(new Rectangle(135, 105, 91, 18));
		}
		return terceiroTextField;
	}

	/**
	 * This method initializes codTerceiroTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getCodTerceiroTextField() {
		if (codTerceiroTextField == null) {
			codTerceiroTextField = new JTextField();
			codTerceiroTextField.setBounds(new Rectangle(135, 135, 91, 18));
		}
		return codTerceiroTextField;
	}

	/**
	 * This method initializes contribuicaoSindicalAutomaticaCheckBox	
	 * 	
	 * @return javax.swing.JCheckBox	
	 */
	private JCheckBox getContribuicaoSindicalAutomaticaCheckBox() {
		if (contribuicaoSindicalAutomaticaCheckBox == null) {
			contribuicaoSindicalAutomaticaCheckBox = new JCheckBox();
			contribuicaoSindicalAutomaticaCheckBox.setBounds(new Rectangle(272, 24, 89, 22));
			contribuicaoSindicalAutomaticaCheckBox.setText("Calcular?");
		}
		return contribuicaoSindicalAutomaticaCheckBox;
	}

	/**
	 * This method initializes mesComercial30diasCheckBox	
	 * 	
	 * @return javax.swing.JCheckBox	
	 */
	private JCheckBox getMesComercial30diasCheckBox() {
		if (mesComercial30diasCheckBox == null) {
			mesComercial30diasCheckBox = new JCheckBox();
			mesComercial30diasCheckBox.setBounds(new Rectangle(272, 49, 57, 22));
			mesComercial30diasCheckBox.setText("Sim?");
		}
		return mesComercial30diasCheckBox;
	}

	@Override
	public void carregaFormulario() {
		// TODO Auto-generated method stub
		GerenciadorEmpresa gerenciadorEmpresa = new GerenciadorEmpresa();
		Empresa empresa = gerenciadorEmpresa.buscarEmpresa(getId());
		
		codEmpresaTextField.setText((String.valueOf(empresa.getId())));
		razaoSocialTextField.setText(empresa.getRazaoSocial());
		cnpjTextField.setText(empresa.getCnpj());
		emailTextField.setText(empresa.getEmail());
		siteTextField.setText(empresa.getSite());
		ruaTextField.setText(empresa.getRua());
		numeroTextField.setText(String.valueOf(empresa.getNumero()));
		complementoTextField.setText(empresa.getComplemento());
		bairroTextField.setText(empresa.getBairro());
		cidadeTextField.setText(empresa.getCidade());
		cepTextField.setText(empresa.getCep());
		telefoneTextField.setText(empresa.getTelefone());
		faxTextField.setText(empresa.getFax());
		// aba calculo
		codQuinquenioTextField.setText(String.valueOf(empresa.getCodQuinquenioEventos()));
		periodoAnoTextField.setText(String.valueOf(empresa.getPeriodoEmAnosEventos()));
		calcDeFeriasTextField.setText(String.valueOf(empresa.getCalcDeFeriasMesesParaMedia()));
		calc13salarioTextField.setText(String.valueOf(empresa.getCalc13SalarioMesesParaMedia()));
		empresaTextField.setText(String.valueOf(empresa.getEmpresaAliquotaGPS()));
		segAcidenteTextField.setText(String.valueOf(empresa.getSegAcidenteAliquotaGPS()));
		terceiroTextField.setText(String.valueOf(empresa.getTerceiroAliquotaGPS()));
		codTerceiroTextField.setText(String.valueOf(empresa.getCodDeTerceiroAliquotaGPS()));
		contribuicaoSindicalAutomaticaCheckBox.setSelected(empresa.isContribuicaoSindicalAutomatica());
		mesComercial30diasCheckBox.setSelected(empresa.isMesComercial30dias());		
	}

	@Override
	public void salvaFormulario() {
		// TODO Auto-generated method stub
		try{
			
			Empresa empresa = new Empresa();
			empresa.setId(1);
			empresa.setRazaoSocial(razaoSocialTextField.getText());
			empresa.setCnpj(cnpjTextField.getText());
			empresa.setEmail(emailTextField.getText());
			empresa.setSite(siteTextField.getText());
			empresa.setRua(ruaTextField.getText());
			empresa.setNumero(Integer.parseInt(numeroTextField.getText()));
			empresa.setComplemento(complementoTextField.getText());
			empresa.setBairro(bairroTextField.getText());
			empresa.setCidade(cidadeTextField.getText());
			empresa.setCep(cepTextField.getText());
			empresa.setTelefone(telefoneTextField.getText());
			empresa.setFax(faxTextField.getText());
			
			// aba calculo
			empresa.setCodQuinquenioEventos(Integer.parseInt(codQuinquenioTextField.getText()));
			empresa.setPeriodoEmAnosEventos(Integer.parseInt(periodoAnoTextField.getText()));
			empresa.setCalcDeFeriasMesesParaMedia(Integer.parseInt(calcDeFeriasTextField.getText()));
			empresa.setCalc13SalarioMesesParaMedia(Integer.parseInt(calc13salarioTextField.getText()));
			empresa.setEmpresaAliquotaGPS(Double.parseDouble(empresaTextField.getText()));
			empresa.setSegAcidenteAliquotaGPS(Double.parseDouble(segAcidenteTextField.getText()));
			empresa.setTerceiroAliquotaGPS(Double.parseDouble(terceiroTextField.getText()));
			empresa.setCodDeTerceiroAliquotaGPS(Integer.parseInt(codTerceiroTextField.getText()));
			empresa.setContribuicaoSindicalAutomatica(contribuicaoSindicalAutomaticaCheckBox.isSelected());
			empresa.setMesComercial30dias(mesComercial30diasCheckBox.isSelected());
			
			GerenciadorEmpresa gerenciadorEmpresa = new GerenciadorEmpresa();
			gerenciadorEmpresa.salvarEmpresa(empresa);
		}catch(NumberFormatException e){
			JOptionPane.showMessageDialog(this, "formato de numero invalido");
		}
		
	}

	@Override
	public void apagarFormulario() {
		// TODO Auto-generated method stub
	}

	@Override
	public void configuraEdicao() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void configuraNovo() {
		// TODO Auto-generated method stub
		
	}

}  //  @jve:decl-index=0:visual-constraint="10,10"
